package com.css.zfzx.data.postgresql.hddcActivefaultPositionerrorPG.repository;

import com.css.zfzx.data.postgresql.hddcActivefaultPG.repository.entity.HddcActivefaultPostgresqlEntity;
import com.css.zfzx.data.postgresql.hddcActivefaultPositionerrorPG.repository.entity.HddcActivefaultPositionerrorPostgresqlEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;

@Repository
public interface HddcActivefaultPositionerrorPostgresqlRepository extends JpaRepository<HddcActivefaultPositionerrorPostgresqlEntity,String> {
    @Query(value = "select fxpc_dcdxbm_sjgl from hddc_activefault_positionerror order by substring(fxpc_dcdxbm_sjgl,22) desc LIMIT 1",
            nativeQuery = true)
     String getGenerateSiteCode();
    @Query(value = "select create_time from hddc_activefault_positionerror  where update_time is null order by create_time desc LIMIT 1",
            nativeQuery = true)
    LocalDateTime findCreateTime();
    @Query(value = "select update_time from hddc_activefault_positionerror where update_time is not null order by update_time desc LIMIT 1",
            nativeQuery = true)
    LocalDateTime findUpdateTime();
}
